import request from '@/utils/request'


//登录api
export function login(data) {
return request({
    url:'/login',
  method:'post',
  data:data

})
}

//获取登录用户的api
export function getLoginUser() {
return request({
  url:'/getloginUser',
  method:'post',
})
}


//获取所有用户的api
export  function  getusers(params){
  return request({
    url:'/users',
    method:'get',
    params,

  })
}



//根据用户id删除用户
export function removeusers(id){

  return request({

    url:`/users/${id}`,
    method:'delete'

  })

}

//添加用户

export function addusers(data){

  return request({

    url:'/users',
    method:'post',
    data

  })

}

//根据id编辑用户信息

export  function  editusers(id,data){
return request({
  url:`/users/${id}`,
  method:'put',
  data,


})

}

//根据id获取用户信息
export function  getusersByid(id){

  return request({
    url:`/users/${id}`,
    method:'get'

  })


}


//根据id更改用户密码
export function editUsersPwd(data){

  return request({

    url:'/users',
    method:'put',
    data


  })

}




